﻿//Example of use only. Unnecessary for use in other projects.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace AutoScrollViewer
{
    /// <summary>
    /// Page for simple demo.
    /// </summary>
    public partial class Page : UserControl
    {
        AutoScroller AS;

        /// <summary>
        /// Page for simple demonstration of AutoScroller
        /// </summary>
        public Page()
        {
            InitializeComponent();
            AS = new AutoScroller(SV, AutoScroller.Mode.Drag);
        }

        private void cmdOff_Click(object sender, RoutedEventArgs e)
        {
            AS.AutoScroll = AutoScroller.Mode.Off;
        }
        private void cmdAuto_Click(object sender, RoutedEventArgs e)
        {
            AS.AutoScroll = AutoScroller.Mode.Auto;
        }
        private void cmdDrag_Click(object sender, RoutedEventArgs e)
        {
            AS.AutoScroll = AutoScroller.Mode.Drag;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Mover newMover = new Mover();
            CvMain.Children.Add(newMover);
            newMover.SetValue(Canvas.LeftProperty, SV.HorizontalOffset + 100);
            newMover.SetValue(Canvas.TopProperty, SV.VerticalOffset + 100);

        }

    }
}
